<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<meta http-equiv="X-UA-Compatible" content="E=edge;chrome=1" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/reset.css">
		<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/weui.min.css">
		<link rel="stylesheet" type="text/css" href="<%=path%>/static/css/index.css">
		<title>嘉华金融</title>
    </head>
   <body>
	<div>
		<div class="header">
			<div><div class="back"></div></div>
			<div>贷款记录</div>
			<div><!-- <div class="user-img"></div> --></div>
		</div>
		<%-- <div class="main">
			<div class="loan-record-wrap">
        		<div class="weui-form-preview" id="loanRecordHtml">
		           <c:forEach items="${list}" var="item" varStatus="vs">
			             <c:if test="${item.state==3}">
			               <div class="weui-form-preview__bd">
				                <div class="weui-form-preview__item">
				                    <label class="weui-form-preview__label loan-title">卡卡贷申请已成功</label>
				                    <span class="weui-form-preview__value record-o-s">2017/8/1</span>
				                </div>
				                <div class="weui-form-preview__item">
				                    <label class="weui-form-preview__label record-o-s">放款时间：2017/8/20</label>
				                </div>
				                <div class="weui-form-preview__item">
				                    <label class="weui-form-preview__label record-o-s">放款金额 ：20000元</label>
				                </div>
				                <div class="weui-form-preview__item">
				                    <label class="weui-form-preview__label record-o-s">放款期限 ：3个月</label>
				                </div>
				                <div class="weui-form-preview__item">
				                    <label class="weui-form-preview__label record-o-s">放款利率 ：1%</label>
				                </div>
				            </div>
			             </c:if>
			             <c:if test="${item.state!=3}">
				            <div class="weui-form-preview__hd">
				                <div class="weui-form-preview__item">
				                    <label class="weui-form-preview__label loan-title">卡卡贷申请正在审核</label>
				                    <em class="weui-form-preview__value record-o-s">2017/8/1</em>
				                </div>
				            </div>
			             </c:if>
			        </c:forEach>
        		</div>
			</div>
		</div>
	</div> --%>
</body>
<script type="text/javascript" src="<%=path%>/static/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
$('.back').on('click', function () {
    window.location= history.back();
});
	<%-- var path="<%=path%>";
	//返回会员中心
	$(".back").click(function() {
		window.location = path + "/member/memberCenter.html"
	});
	
	//Id:标编号
	//Status：             3=成功
	//SuccessDate： 放款时间
	//Amount:      放款金额 单位(元)
	//Month:       放款期限 单位(月)
	//CurrentRate: 放款利率 单位(%)
    var data = '{"Code":1,"Msg":"","ExceptionMsg":"","Content":[{"Id":1389045,"Status":3,"SuccessDate":"2017/8/1","Amount":100,"Month":3,"CurrentRate":"20"},{"Id":909591,"Status":2,"SuccessDate":"2017/8/1","Amount":8000.0000,"Month":12,"CurrentRate":22},{"Id":234920,"Status":1,"SuccessDate":"2017/8/1","Amount":0,"Month":0,"CurrentRate":null},{"Id":234922,"Status":1,"SuccessDate":"2017/8/1","Amount":0,"Month":0,"CurrentRate":null},{"Id":234925,"Status":1,"SuccessDate":"2017/8/1","Amount":0,"Month":0,"CurrentRate":null},{"Id":240670,"Status":1,"SuccessDate":"2017/8/1","Amount":0,"Month":0,"CurrentRate":null},{"Id":241564,"Status":1,"SuccessDate":"2017/8/1","Amount":0,"Month":0,"CurrentRate":null}]}';
	var json = eval("(" + data + ")");
		var content = json.Content;
		var html = "";
		for ( var i in content) {
			if(content[i].Status==3){
				html=html+'<div class="weui-form-preview__bd">'+
				             '<div class="weui-form-preview__item ">'+
				                '<label class="weui-form-preview__label loan-title">卡卡贷申请已成功</label>'+
				                '<span class="weui-form-preview__value record-o-s">'+content[i].SuccessDate+'</span>'+
				            '</div>'+
				            '<div class="weui-form-preview__item" >'+
				                '<label class="weui-form-preview__label record-o-s">放款时间：'+content[i].SuccessDate+'</label>'+
				            '</div>'+
				            '<div class="weui-form-preview__item " >'+
				                '<label class="weui-form-preview__label record-o-s">放款金额 ：'+content[i].Amount+'(元)</label>'+
				            '</div>'+
				            '<div class="weui-form-preview__item ">'+
				                '<label class="weui-form-preview__label record-o-s">放款期限 ：'+content[i].Month+'(月)</label>'+
				            '</div>'+
				            '<div class="weui-form-preview__item loan-bottom">'+
				                '<label class="weui-form-preview__label record-o-s">放款利率 ：'+content[i].CurrentRate+'(%)</label>'+
				            '</div>'+
				        '</div>';
			}else{
				html=html+'<div class="weui-form-preview__bd">'+
				             '<div class="weui-form-preview__item loan-bottom">'+
				                '<label class="weui-form-preview__label loan-title">卡卡贷申请正在审核</label>'+
				                '<span class="weui-form-preview__value record-o-s">'+content[i].SuccessDate+'</span>'+
				            '</div>'+
				        '</div>';
				
			}
			
			var divshow = $("#loanRecordHtml");
            divshow.text("");// 清空数据
            divshow.append(html); 
		
		}
		
	//getUserListing();

	
	//申请前查询当前用户的 查寻信息接口
	function getUserListing() {
		$.ajax({
			url : path + "/home/getUserListing.html",
			type : "POST",
			dataType : "json",
			data : {
				"phone" : $("#phone").val(),
				"openid" : $("#openid").val()
			},
			success : function(data) {
				var json = eval("(" + data + ")");
				if (json.Code == 1) {
					var content = json.Content;
					for ( var i in content) {
						//Id:标编号
						//Status：             3=成功
						//SuccessDate： 放款时间
						//Amount:      放款金额 单位(元)
						//Month:       放款期限 单位(月)
						//CurrentRate: 放款利率 单位(%)
						console.log(i, ":", content[i].Id);
					}
				} else {
					layer.msg(json.Msg);
				}

			},
			error : function(r, s, m) {
			}
		});
	}
	
	
	//查询贷款记录
	function getMemberCenter() {
		$.ajax({
			url : path + "/home/getUserListing.html",
			type : "POST",
			dataType : "json",
			data : {
				"phone" : $("#phone").val(),
				"openid" : $("#openid").val()
			},
			success : function(data) {
				var json = eval("(" + data + ")");
				if (json.Code == 1) {
					var content = json.Content;
					for ( var i in content) {
						//Id:标编号
						//Status：             3=成功
						//SuccessDate： 放款时间
						//Amount:      放款金额 单位(元)
						//Month:       放款期限 单位(月)
						//CurrentRate: 放款利率 单位(%)
						console.log(i, ":", content[i].Id);
					}
				} else {
					layer.msg(json.Msg);
				}

			},
			error : function(r, s, m) {
			}
		});
	} --%>
</script>
</html>
